home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 August / MW 8 2003 CD1.iso / Inside Macworld / Product News / gimp-1.2.4.sit / gimp-1.2.4 / plug-ins / perl / UI / UI.xs < prev   
Encoding:
Text File  |  2000-08-24  |  1.9 KB  |  94 lines

  1. #include "config.h"
  2.  
  3. /* dunno where this comes from */
  4. #undef VOIDUSED
  5.  
  6. #include "EXTERN.h"
  7. #include "perl.h"
  8. #include "XSUB.h"
  9. #define NEED_newCONSTSUB
  10. #include "gppport.h"
  11.  
  12. /* dirty is used in gimp.h AND in perl < 5.005 or with PERL_POLLUTE.  */
  13. #ifdef dirty
  14. # undef dirty
  15. #endif
  16. #include <libgimp/gimp.h>
  17. #include <libgimp/gimpui.h>
  18. #ifdef GIMP_HAVE_EXPORT
  19. #include <libgimp/gimpexport.h>
  20. #endif
  21.  
  22. /* libgimo requires a rather broken interface. this must be here because..
  23.  * well, nobody knows why... ARGH! */
  24. GimpPlugInInfo PLUG_IN_INFO = { 0, 0, 0, 0 };
  25.  
  26. #if 0
  27. static void gimp_pattern_select_widget_callback (gchar *name, gint width,
  28.     gint height, gint bpp, gchar *mask, gint closing, gpointer nameref)
  29. {
  30.   SV *sv = (SV *)nameref;
  31.   sv_setpv (sv, name);
  32. }
  33. #endif
  34.  
  35. static void need_gtk (void)
  36. {
  37.   gint argc = 0;
  38.   
  39.   gtk_init_check (&argc, 0); /* aaaaargh */
  40. }
  41.  
  42. MODULE = Gimp::UI    PACKAGE = Gimp::UI
  43.  
  44. PROTOTYPES: ENABLE
  45.  
  46. #if defined(GIMP_HAVE_EXPORT)
  47.  
  48. gint32
  49. export_image(image_ID,drawable_ID,format_name,capabilities)
  50.     SV *    image_ID
  51.         SV *    drawable_ID
  52.         gchar *    format_name
  53.         gint    capabilities
  54.         CODE:
  55.         gint32 image = SvIV(SvRV(image_ID));
  56.         gint32 drawable = SvIV(SvRV(drawable_ID));
  57.         need_gtk ();
  58.         RETVAL = gimp_export_image (&image, &drawable, format_name, capabilities);
  59.         sv_setiv (SvRV(image_ID), image);
  60.         sv_setiv (SvRV(drawable_ID), drawable);
  61.     OUTPUT:
  62.         image_ID
  63.         drawable_ID
  64.         RETVAL
  65.  
  66. #endif
  67.  
  68. #if 0
  69. #if UI
  70. #if GIMP11
  71.  
  72. GtkWidget *
  73. _new_pattern_select(dname, ipattern, nameref)
  74.     gchar *    dname
  75.     gchar *    ipattern
  76.     SV *    nameref
  77.     CODE:
  78.     {
  79.         if (!SvROK (nameref))
  80.           croak (__("last argument to gimp_pattern_select_widget must be scalar ref"));
  81.         
  82.         nameref = SvRV (nameref);
  83.         SvUPGRADE (nameref, SVt_PV);
  84.         
  85.         RETVAL = gimp_pattern_select_widget (dname, ipattern,
  86.                 gimp_pattern_select_widget_callback, (gpointer) nameref);
  87.     }
  88.     OUTPUT:
  89.     RETVAL
  90.  
  91. #endif
  92. #endif
  93. #endif
  94.